<tpl var layoutBody={ />
<div data-identity="sys:resource" data-table="sys_resource">
	<div class="layui-breadcrumb">
		<a href="/manage/index.jspx">首页</a>
		<a href="javascript:;">
			<cite>资源管理</cite>
		</a>
	</div>
	<hr>
	<form class="layui-form layui-form-pane" lay-filter="mSysResourceSearchForm">
		<div class="layui-form-item layui-inline nobottom">
			<label class="layui-form-label width-auto">资源ID</label>
			<div class="layui-input-inline">
				<input type="text" name="id" placeholder="请输入资源ID" autocomplete="off" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item layui-inline nobottom">
			<label class="layui-form-label width-auto">资源名称</label>
			<div class="layui-input-inline">
				<input type="text" name="name" placeholder="请输入资源名称" autocomplete="off" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item layui-inline nobottom">
			<button class="layui-btn" lay-submit lay-filter="mSysResourceSearchForm">查找</button>
		</div>
	</form>
	<table class="layui-table" lay-data="{height: 'full-220', page: {hash: 'page'}, limit:30, loading:true, url:'list.json',id: 'mSysResourceTable'}" lay-filter="mSysResourceTableFilter">
		<thead>
			<tr>
				<th lay-data="{field:'id', align: 'center', width:60}">ID</th>
				<th lay-data="{field:'pid', align: 'center', width:60}">PID</th>
				<th lay-data="{align: 'center', width:140, templet: '#format-icon-tpl'}">图标</th>
				<th lay-data="{field:'name'}">资源名称</th>
				<th lay-data="{field:'identity'}">资源标识</th>
				<th lay-data="{field:'linkurl'}">连接地址</th>
				<th lay-data="{fixed: 'right', width:140, align:'center', toolbar: '#toolbar-tpl'}"></th>
			</tr>
		</thead>
	</table>
</div>
<tpl }; />

<tpl var layoutScript={ />
<script>
	layui.config({
		base: '${webCdn}/plugins/layui/mods/'
	}).extend({
		eventbus: 'extend/eventbus/eventbus'
	}).use(['element', 'eventbus', 'table'], function () {
		// 搜索框表单提交事件
		layui.form.on('submit(mSysResourceSearchForm)', function (data) {
			layui.table.reload('mSysResourceTable', {
				where: data.field,
				page: {
					'curr': 1
				}
			});
			return false;
		});
	});
</script>
<script type="text/html" id="format-icon-tpl">
	<i class="{{d.icon}}"></i>
</script>
<script type="text/html" id="toolbar-tpl">
	<div class="layui-btn-group">
		<a href="update.jspx?id={{d.id}}" class="layui-btn layui-btn-xs">编辑</a>
	</div>
</script>
<tpl }; />
<tpl include( "../../tpl/layout.html",{identity: "sys:resource",layoutBody:layoutBody,layoutScript:layoutScript}){}/>